//
//  YYT_UserTableViewCell.m
//  AudioVisualFeast
//
//  Created by 温晓宇 on 16/1/29.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "YYT_UserTableViewCell.h"

@interface YYT_UserTableViewCell ()

@property (nonatomic, strong)UIButton *loginButton;
@property (nonatomic, strong)UIButton *regisButton;

@end

@implementation YYT_UserTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}
- (void)create{
    self.loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _loginButton.frame = CGRectMake(WIDTH / 3 - 10, 50, 50, 30);
    _loginButton.backgroundColor = [UIColor clearColor];
    [_loginButton setTitle:@"登录" forState:UIControlStateNormal];
    [self.contentView addSubview:_loginButton];
    [_loginButton addTarget:self action:@selector(loginButton:) forControlEvents:UIControlEventTouchUpInside];
    
    self.regisButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _regisButton.frame = CGRectMake(WIDTH / 3 + 70, 50, 50, 30);
    _regisButton.backgroundColor = [UIColor clearColor];
    [_regisButton setTitle:@"注册" forState:UIControlStateNormal];
    [self.contentView addSubview:_regisButton];
    [_regisButton addTarget:self action:@selector(regisButton:) forControlEvents:UIControlEventTouchUpInside];
}

-(void)regisButton:(UIButton *)btn{
    NSLog(@"注册");
    [self.delegate regisView];
}

- (void)loginButton:(UIButton *)btn{
    NSLog(@"登录");
    [self.delegate loginView];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
